//
// Created by 谢哲 on 2021/4/22.
//

#include <iostream>
#include <vector>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n, m;
    cin >> n >> m;
    vector<int> vdata(n+1, 0);

    for (;m;--m) {
        int a;
        cin >> a;
        vdata[a]++;
    }

    for (int i=1; i<=n; ++i) {
        for (int j=0; j<vdata[i]; ++j) {
            cout << i << " ";
        }
    }

    return 0;
}